home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / CREATE.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  1KB  |  42 lines

  1. ;    DESC:    Creates a new data file                              V1.00
  2. ;    IN:    *{SEG_VAL} segment and
  3. ;        *{OFFSET} offset of filename to be created as ASCIIZ string
  4. ;        *{ATRB} attribute or mode of file as listed in CHG_MOD
  5. ;         command
  6. ;    OUT:    *{OUTHNDL} handle of file created
  7. ;    SAMPLE:    Callm    CREATE,<SEG_VAL,OFFSET,ATRB>,<OUTHNDL>
  8. ;    ################################################################### 
  9.  
  10.     Extrn    PUSHALL:Near
  11.     Extrn    POPALL:Near
  12.     Extrn    ERRORMSG:Near
  13.  
  14. CREATEC    Segment
  15.     Assume    CS:CREATEC
  16.     Public    CREATE
  17.  
  18.                         ;notice.
  19.     DB    'CREATE   - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  20.  
  21. CREATE    Proc    Near                ;creates a file.
  22.     Call    PUSHALL
  23.  
  24.     Pop    CX                ;get the attribute.
  25.     Pop    DX                ;get the filename offset.
  26.     Pop    DS                ;get the segment offset.
  27.  
  28.     Mov    AH,3CH                ;create a file.
  29.     Int    21H
  30.     Jc    ERROR                ;if error, report it.
  31.  
  32.     Push    AX                ;if no error return handle.
  33.     Call    POPALL
  34.     Ret
  35.  
  36. ERROR:    Push    AX                ;report error and abort.
  37.     Call    ERRORMSG
  38.  
  39. CREATE    Endp
  40. CREATEC    Ends
  41.     End
  42.